module RestBase
  module Authentication
    class BasicAuthentication < AuthenticationBase
      def initialize(keys)
        @valid_keys = keys
      end

      def authorized?(request, key)
        authorized = true
        authorized = @valid_keys.include?(key) unless @valid_keys.length == 0
        authorized
      end
    end
  end
end